#pragma once

#include "rclcpp/rclcpp.hpp"
#include <std_msgs/msg/string.hpp>
#include "geometry_msgs/msg/transform_stamped.hpp" // 提供消息接口
#include "tf2/LinearMath/Quaternion.h"             // 提供 tf2::Quaternion 类
#include "tf2_geometry_msgs/tf2_geometry_msgs.h"   // 提供消息类型转换函数
#include "tf2_ros/static_transform_broadcaster.h"  // 提供静态坐标广播器类
#include "tf2_ros/transform_broadcaster.h"         // 提供动态坐标广播器类
#include "tf2_ros/transform_listener.h"            // 提供坐标监听器类
#include "tf2/utils.h"                             // 提供 tf2::getEulerYPR 函数

using namespace std;
using namespace std::chrono_literals;
using namespace rclcpp;

class TF : public rclcpp::Node
{
public:
    TF();
    void Timer_Callback_01();
    void publish_tf_static();
    void publish_tf_Timer_Callback();
    void get_Transform_Timer_Callback();

private:
    TimerBase::SharedPtr Timer_01_tf;
    TimerBase::SharedPtr Timer_02_tf_listener;

    std::shared_ptr<tf2_ros::StaticTransformBroadcaster> tf_static_broadcaster_;
    std::shared_ptr<tf2_ros::TransformBroadcaster> tf_broadcaster_;
    std::unique_ptr<tf2_ros::Buffer> buffer_;
    std::shared_ptr<tf2_ros::TransformListener> listener_;
};
